#include <iostream>
#include <vector>

using namespace std;

const int* find_num(const vector<int> &vec, int value);

int main()
{
    vector<int> vec {45, 78, 15, 74, 545, 42};
    for (int ix = 0; ix < (int)vec.size(); ix++)
        cout << vec[ix] << " ";
    cout << endl
         << *find_num(vec, 42);
}


const int* find_num(const vector<int>& vec, int value)
{
    for (int ix = 0; ix < (int)vec.size(); ix++)
        if (vec[ix] == value)
        return &vec[ix];
    return 0;
}
